import { QXEvent } from "qx-util";
import { IParam, ListExpBarActionType, IListExpBarAbility, IListExpBarControllerParams, IListExpBarStore, ListExpBarController, ICtrlEvent, IListExpBarController, IListExpBarModel } from "@/core";
import { useListExpBarAction, useListExpBarBasic, useListExpBarControllerParams, useListExpBarProps } from "@/hooks/widget/use-list-exp-bar";
import { model } from "./list-exp-viewlistexpbar-list-exp-bar-model";
// 基于template/src/widgets/{{appEntities}}/{{ctrls@LISTEXPBAR}}-list-exp-bar/{{spinalCase ctrl.codeName}}-list-exp-bar-hook.ts.hbs生成
/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useListExpBarProps(),
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useListExpBarBasic(model, props),
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
		...useListExpBarAction(controller),
	};
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<ICtrlEvent<ListExpBarActionType, IListExpBarAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<ICtrlEvent<ListExpBarActionType, IListExpBarAbility>>,
    otherParams: IParam = {},
): IListExpBarController<IListExpBarStore, IListExpBarAbility> {
	const params: IListExpBarControllerParams<ListExpBarActionType, IListExpBarAbility> =
		useListExpBarControllerParams<IListExpBarStore, IListExpBarModel>(model, props, evt, otherParams);
  	return new ListExpBarController(params);
}